package cn.sccl.test.fetchsize;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.Test;

import cn.sccl.domain.Customer;
import cn.sccl.utils.HibernateUtils;

/**
 * @author raoshuang
 * @date 2019年8月28日下午3:01:48
 * @version 1.0.0
 * 抓取数量
 */
public class FetchsizeDemo {
	@Test
	public void fun1(){
		Session session = HibernateUtils.openSession();
		Transaction tx = session.beginTransaction();
		
		String hql = "from Customer ";
		Query query = session.createQuery(hql);
		List<Customer> list = query.list();
		
		for(Customer c:list){
			System.out.println(c.getLinkMens());
		}
		
		tx.commit();
		session.close();
	}
}
